package lowijs.XfireClient;

public class Friend {
	private String login, nick, statustext = null, gamename = null;
	private byte[] userid, sid, image;
	
	public Friend(String login) {
		this.login = login;
	}
	
	public String getLogin() {
		return login;
	}
	
	public void setLogin(String login) {
		this.login = login;
	}
		
	public String getNick() {
		return nick;
	}
	
	public void setNick(String nick) {
		this.nick = nick;
	}
	
	public String getStatusText() {
		if (gamename != null)
			return gamename;
		else
			return statustext;
	}
	
	public void setStatusText(String statustext) {
		this.statustext = statustext;
	}
	
	public void setInGame(String gamename, byte[] image) {
		this.gamename = gamename;
		this.image = image;
	}
	
	public void setOutOfGame() {
		gamename = null;
		image = null;
	}
	
	public byte[] getUserid() {
		return userid;
	}
	
	public void setUserid(byte[] userid) {
		this.userid = userid;
	}
	
	public byte[] getSid() {
		return sid;
	}
	
	public void setSid(byte[] sid) {
		this.sid = sid;
	}
	
	public byte[] getImage() {
		return image;
	}
	
	public void setOffline() {
		sid = null;
	}
	
	public boolean isOnline() {
		return sid != null;
	}
	
	public void sendIM(String message) {
		Conversation cv = ConversationManager.getInstance().getConversation(this);
		cv.sendIM(message);
	}
}
